var t = getApp();

Page({
    data: {
        active: "随意",
        page: 1,
        finished: !1,
        newcomerReward: [],
        vanTab: [ {
            title: "全部",
            id: "随意"
        }, {
            title: "预计奖励",
            id: 4
        }, {
            title: "待结算",
            id: 1
        }, {
            title: "已结算",
            id: 2
        }, {
            title: "无效奖励",
            id: 3
        } ],
        yz_basic_info: {}
    },
    onLoad: function(t) {
        this.setData({
            yz_basic_info: wx.getStorageSync("yz_basic_info")
        }), this.getData();
    },
    getData: function() {
        var a = this;
        if (!this.data.finished) {
            var e = t.getNetAddresss("plugin.newcomer-fission.frontend.controllers.list.index");
            t._getNetWork({
                url: e,
                data: {
                    page: this.data.page,
                    record_status: this.data.active
                },
                success: function(t) {
                    if (1 !== t.data.result) return wx.showToast({
                        title: t.data.msg
                    }), !1;
                    var e, i = t.data.data, n = !1;
                    (0 === i.data.length || i.data.length < i.per_page || i.current_page === i.last_page) && (n = !0), 
                    e = a.data.newcomerReward.concat(i.data), a.setData({
                        finished: n,
                        newcomerReward: e,
                        page: ++a.data.page
                    });
                }
            });
        }
    },
    onReachBottom: function() {
        this.getData();
    },
    changeTabs: function(t) {
        this.setData({
            page: 1,
            finished: !1,
            active: t.detail.name,
            newcomerReward: []
        }), this.getData();
    }
});